package(default_testonly = 1)

licenses(["notice"])

java_test(
    name = "ChaCha20UtilTest",
    size = "small",
    srcs = ["ChaCha20UtilTest.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:cha_cha20_util",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "InsecureNonceAesGcmJceTest",
    srcs = ["InsecureNonceAesGcmJceTest.java"],
    data = ["@wycheproof//testvectors:all"],
    tags = [
        "fips",
        "notsan",
    ],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_aes_gcm_jce",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
        "//src/main/java/com/google/crypto/tink/config/internal:tink_fips_util",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "//src/main/java/com/google/crypto/tink/testing:wycheproof_test_util",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_code_gson_gson",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
        "@maven//:org_conscrypt_conscrypt_openjdk_uber",
    ],
)

java_test(
    name = "InsecureNonceChaCha20Test",
    size = "small",
    srcs = ["InsecureNonceChaCha20Test.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_cha_cha20",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "InsecureNonceChaCha20Poly1305Test",
    size = "small",
    srcs = ["InsecureNonceChaCha20Poly1305Test.java"],
    data = ["@wycheproof//testvectors:all"],
    tags = [
        "fips",
        "notsan",
    ],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_cha_cha20_poly1305",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "//src/main/java/com/google/crypto/tink/testing:wycheproof_test_util",
        "@maven//:com_google_code_gson_gson",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "InsecureNonceXChaCha20Poly1305Test",
    size = "large",
    srcs = ["InsecureNonceXChaCha20Poly1305Test.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_x_cha_cha20_poly1305",
        "//src/main/java/com/google/crypto/tink/aead/internal:poly1305",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "InsecureNonceXChaCha20Test",
    size = "small",
    srcs = ["InsecureNonceXChaCha20Test.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_x_cha_cha20",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "Poly1305Test",
    size = "small",
    srcs = ["Poly1305Test.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:poly1305",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "AesGcmProtoSerializationTest",
    size = "small",
    srcs = ["AesGcmProtoSerializationTest.java"],
    deps = [
        "//proto:aes_gcm_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:aes_gcm_key",
        "//src/main/java/com/google/crypto/tink/aead:aes_gcm_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:aes_gcm_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "XChaCha20Poly1305ProtoSerializationTest",
    size = "small",
    srcs = ["XChaCha20Poly1305ProtoSerializationTest.java"],
    deps = [
        "//proto:tink_java_proto",
        "//proto:xchacha20_poly1305_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:x_cha_cha20_poly1305_key",
        "//src/main/java/com/google/crypto/tink/aead:x_cha_cha20_poly1305_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:x_cha_cha20_poly1305_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "LegacyAesCtrHmacTestKeyManagerTest",
    size = "small",
    srcs = ["LegacyAesCtrHmacTestKeyManagerTest.java"],
    deps = [
        "//proto:aes_ctr_hmac_aead_java_proto",
        "//proto:aes_ctr_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:registry",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink:tink_proto_parameters_format",
        "//src/main/java/com/google/crypto/tink/aead:aead_wrapper",
        "//src/main/java/com/google/crypto/tink/aead/internal:legacy_aes_ctr_hmac_test_key_manager",
        "//src/main/java/com/google/crypto/tink/subtle:encrypt_then_authenticate",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "LegacyFullAeadTest",
    size = "small",
    srcs = ["LegacyFullAeadTest.java"],
    deps = [
        "//proto:aes_ctr_hmac_aead_java_proto",
        "//proto:aes_ctr_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/aead/internal:legacy_aes_ctr_hmac_test_key_manager",
        "//src/main/java/com/google/crypto/tink/aead/internal:legacy_full_aead",
        "//src/main/java/com/google/crypto/tink/internal:legacy_proto_key",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/subtle:aes_gcm_jce",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/util:bytes",
        "@maven//:com_google_code_findbugs_jsr305",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "ChaCha20Poly1305JceTest",
    size = "small",
    srcs = ["ChaCha20Poly1305JceTest.java"],
    data = ["@wycheproof//testvectors:all"],
    deps = [
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/aead:cha_cha20_poly1305_key",
        "//src/main/java/com/google/crypto/tink/aead:cha_cha20_poly1305_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:cha_cha20_poly1305_jce",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "//src/main/java/com/google/crypto/tink/testing:wycheproof_test_util",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_code_gson_gson",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "InsecureNonceChaCha20Poly1305JceTest",
    size = "small",
    srcs = ["InsecureNonceChaCha20Poly1305JceTest.java"],
    data = ["@wycheproof//testvectors:all"],
    deps = [
        "//src/main/java/com/google/crypto/tink/aead/internal:insecure_nonce_cha_cha20_poly1305_jce",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "//src/main/java/com/google/crypto/tink/testing:wycheproof_test_util",
        "@maven//:com_google_code_gson_gson",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "XChaCha20Poly1305JceTest",
    size = "small",
    srcs = ["XChaCha20Poly1305JceTest.java"],
    deps = [
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink/aead:x_cha_cha20_poly1305_key",
        "//src/main/java/com/google/crypto/tink/aead:x_cha_cha20_poly1305_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:x_cha_cha20_poly1305_jce",
        "//src/main/java/com/google/crypto/tink/config:tink_fips",
        "//src/main/java/com/google/crypto/tink/internal:util",
        "//src/main/java/com/google/crypto/tink/subtle:bytes",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "//src/main/java/com/google/crypto/tink/subtle:random",
        "//src/main/java/com/google/crypto/tink/testing:test_util",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "LegacyFullAeadIntegrationTest",
    size = "small",
    srcs = ["LegacyFullAeadIntegrationTest.java"],
    deps = [
        "//proto:aes_ctr_hmac_aead_java_proto",
        "//proto:aes_ctr_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:aead",
        "//src/main/java/com/google/crypto/tink:crypto_format",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:registry_cluster",
        "//src/main/java/com/google/crypto/tink:tink_proto_keyset_format",
        "//src/main/java/com/google/crypto/tink:tink_proto_parameters_format",
        "//src/main/java/com/google/crypto/tink/aead:aead_config",
        "//src/main/java/com/google/crypto/tink/aead/internal:legacy_aes_ctr_hmac_test_key_manager",
        "//src/main/java/com/google/crypto/tink/subtle:hex",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "AesCtrHmacAeadProtoSerializationTest",
    size = "small",
    srcs = ["AesCtrHmacAeadProtoSerializationTest.java"],
    deps = [
        "//proto:aes_ctr_hmac_aead_java_proto",
        "//proto:aes_ctr_java_proto",
        "//proto:common_java_proto",
        "//proto:hmac_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:aes_ctr_hmac_aead_key",
        "//src/main/java/com/google/crypto/tink/aead:aes_ctr_hmac_aead_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:aes_ctr_hmac_aead_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "AesEaxProtoSerializationTest",
    size = "small",
    srcs = ["AesEaxProtoSerializationTest.java"],
    deps = [
        "//proto:aes_eax_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:aes_eax_key",
        "//src/main/java/com/google/crypto/tink/aead:aes_eax_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:aes_eax_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "AesGcmSivProtoSerializationTest",
    size = "small",
    srcs = ["AesGcmSivProtoSerializationTest.java"],
    deps = [
        "//proto:aes_gcm_siv_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:aes_gcm_siv_key",
        "//src/main/java/com/google/crypto/tink/aead:aes_gcm_siv_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:aes_gcm_siv_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)

java_test(
    name = "ChaCha20Poly1305ProtoSerializationTest",
    size = "small",
    srcs = ["ChaCha20Poly1305ProtoSerializationTest.java"],
    deps = [
        "//proto:chacha20_poly1305_java_proto",
        "//proto:tink_java_proto",
        "//src/main/java/com/google/crypto/tink:insecure_secret_key_access",
        "//src/main/java/com/google/crypto/tink:key",
        "//src/main/java/com/google/crypto/tink:parameters",
        "//src/main/java/com/google/crypto/tink/aead:cha_cha20_poly1305_key",
        "//src/main/java/com/google/crypto/tink/aead:cha_cha20_poly1305_parameters",
        "//src/main/java/com/google/crypto/tink/aead/internal:cha_cha20_poly1305_proto_serialization",
        "//src/main/java/com/google/crypto/tink/internal:mutable_serialization_registry",
        "//src/main/java/com/google/crypto/tink/internal:proto_key_serialization",
        "//src/main/java/com/google/crypto/tink/internal:proto_parameters_serialization",
        "//src/main/java/com/google/crypto/tink/internal/testing:asserts",
        "//src/main/java/com/google/crypto/tink/util:secret_bytes",
        "@maven//:com_google_protobuf_protobuf_java",
        "@maven//:com_google_truth_truth",
        "@maven//:junit_junit",
    ],
)
